__author__ = 'Jerry Liu'
import socket

HOST = '127.0.0.1'
PORT = 1234
ADDR = (HOST, PORT)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(ADDR)

while True:
    data = input('Please input your cmd:')
    s.send(data.encode())
    result = s.recv(1024).decode()
    print(result)
    if not data:
        break
s.close()